import tkinter as tk

from ttzScrapyProject.utils import DateUtils


def get_label_value(window, age_label):
    # label_value = age_label["text"]
    age_label.config(text=DateUtils.getDate())
    # print("Label Value:", label_value)
    window.after(1000, lambda: get_label_value(window, age_label))


if __name__ == '__main__':
    window = tk.Tk()

    age_label = tk.Label(window, text="密码:")
    age_label.pack()

    button = tk.Button(window, text="Get Label Value", command=get_label_value)
    button.pack()
    window.after(1000, lambda: get_label_value(window, age_label))
    window.mainloop()
